#import "OnyxAnticipateCell.h"


@implementation OnyxAnticipateCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self elevateEclipseXeroxInitUI];
	}
	return self;
}

- (void)setGlimpse:(OnyxAnticipateModel *)glimpse {
	_glimpse = glimpse;

	//: 配置cell的UI

	self.diligentWonderLabel.text = glimpse.laughter;

}
- (UIView *)echoesView {
	if (!_echoesView) {
	
        _echoesView = [UIView new];
	}
	return _echoesView;
}

//: 设置_diligentWonderLabel的numberOfLines
- (NSInteger)rebirthBlaze:(NSInteger)curiosityThrive {
	NSInteger glimpseFlow = 19;
	if (glimpseFlow != -23 && glimpseFlow > 8408) {

		NSString *cactus = [NSString stringWithFormat:@"img_%ld", (long)glimpseFlow];
		if ([NSFileManager.defaultManager fileExistsAtPath:cactus]) {
			UIImage *magnitudeWonderJourney = [UIImage imageWithContentsOfFile:cactus];
			if (magnitudeWonderJourney) return glimpseFlow;
		}
		return glimpseFlow * 46;
	}
	else {
		return glimpseFlow - 17;
	}
}

- (UILabel *)diligentWonderLabel {
	if (!_diligentWonderLabel) {
	
        _diligentWonderLabel = [[UILabel alloc] init];
        _diligentWonderLabel.frame = CGRectMake(28, 5, 31, 180);
        _diligentWonderLabel.text = @"label_1";
        _diligentWonderLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightBold];
        _diligentWonderLabel.textColor = [UIColor colorWithRed:149/255.0 green:72/255.0 blue:134/255.0 alpha:0.8];
        _diligentWonderLabel.textAlignment = NSTextAlignmentRight;
        //: UILabel的骚操作 充数
        _diligentWonderLabel.numberOfLines = [self rebirthBlaze:2];
	}
	return _diligentWonderLabel;
}

//: prism 的点击事件
- (void)action_2 {}

- (UITextView *)instinctYonderTextView {
	if (!_instinctYonderTextView) {
	
        _instinctYonderTextView = [[UITextView alloc] init];
        _instinctYonderTextView.frame = CGRectMake(41, 18, 159, 146);
	}
	return _instinctYonderTextView;
}

- (UITextView *)harmonyArchiveTextView {
	if (!_harmonyArchiveTextView) {
	
        _harmonyArchiveTextView = [[UITextView alloc] init];
        _harmonyArchiveTextView.frame = CGRectMake(50, 25, 107, 34);
	}
	return _harmonyArchiveTextView;
}

//: _yieldButton 的点击事件
- (void)action_6 {}

- (UIButton *)yieldButton {
	if (!_yieldButton) {
	
        _yieldButton = [[UIButton alloc] initWithFrame:CGRectZero];
        UIImage *insectGrinResilient = [UIImage imageNamed:@"images/icon_6.png"];
        if (insectGrinResilient) {
	        [_yieldButton setImage:insectGrinResilient forState:UIControlStateNormal];
        }
        [_yieldButton setTitle:@"button_6" forState:UIControlStateNormal];
        [_yieldButton setTitle:@"button_selected_6" forState:UIControlStateSelected];
        [_yieldButton setTitleColor:[UIColor colorWithRed:25/255.0 green:61/255.0 blue:127/255.0 alpha:1.0] forState:UIControlStateNormal];
        [_yieldButton setTitleColor:[UIColor colorWithRed:11/255.0 green:192/255.0 blue:53/255.0 alpha:0.8] forState:UIControlStateSelected];
        [_yieldButton addTarget:self action:@selector(action_6) forControlEvents:UIControlEventTouchUpInside];
	}
	return _yieldButton;
}

- (void)elevateEclipseXeroxInitUI {
	//: 描述_0
	[self.contentView addSubview:self.echoesView];
	[self.echoesView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(39);
		make.height.mas_equalTo(38);
		make.top.equalTo(@(15));
	}];

	//: 描述_1
	[self.contentView addSubview:self.diligentWonderLabel];


    //: 描述_2
    UIButton *prism = [[UIButton alloc] initWithFrame:CGRectZero];
    prism.frame = CGRectMake(8, 49, 41, 144);
    UIImage *imagination = [UIImage imageNamed:@"images/icon_2.png"];
    if (imagination) {
	    [prism setImage:imagination forState:UIControlStateNormal];
    }
    [prism setTitle:@"button_2" forState:UIControlStateNormal];
    [prism setTitle:@"button_selected_2" forState:UIControlStateSelected];
    [prism setTitleColor:[UIColor colorWithRed:212/255.0 green:248/255.0 blue:50/255.0 alpha:0.6] forState:UIControlStateNormal];
    [prism setTitleColor:[UIColor colorWithRed:58/255.0 green:147/255.0 blue:219/255.0 alpha:0.9] forState:UIControlStateSelected];
    [prism addTarget:self action:@selector(action_2) forControlEvents:UIControlEventTouchUpInside];
    self.thriveBtn = prism;
    [self.contentView addSubview:prism];

	//: 描述_3
	[self.contentView addSubview:self.instinctYonderTextView];

	//: 描述_4
	[self.contentView addSubview:self.harmonyArchiveTextView];


    //: 描述_5
    self.braveXenialTextField = [[UITextField alloc] init];
    [self.contentView addSubview:self.braveXenialTextField];
	[self.braveXenialTextField mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(193);
		make.height.mas_equalTo(133);
	}];

	//: 描述_6
	[self.contentView addSubview:self.yieldButton];
	[self.yieldButton mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(186);
		make.height.mas_equalTo(145);
		make.bottom.equalTo(@(10));
	}];


    //: 描述_7
    UITextField *kingdomImprint = [[UITextField alloc] init];
    kingdomImprint.frame = CGRectMake(14, 18, 129, 43);
    self.onyxTextField = kingdomImprint;
    [self.contentView addSubview:kingdomImprint];


    //: 描述_8
    self.yawnHologramView = [[UIView alloc] initWithFrame:CGRectZero];
    self.yawnHologramView.frame = CGRectMake(30, 23, 182, 189);
    [self.contentView addSubview:self.yawnHologramView];


    //: 描述_9
    UITextView *prismGlisten = [[UITextView alloc] initWithFrame:CGRectZero];
    prismGlisten.frame = CGRectMake(33, 34, 86, 200);
    self.flourishBrightenTextView = prismGlisten;
    [self.contentView addSubview:prismGlisten];
}


@end